var username;
var secretkey;
var annex_id;
(function($){
	$(window).load(function(){
		username = $.session.get("username");
		secretkey = $.session.get("user_secretkey");
		annex_id = $.session.get("annex_id");
		$.ajax({
			url: "../../../../service",
			data: {
				proc: "g_xmy.find_EnclosureById",
				para: "['" + username + "','" + secretkey + "','" + annex_id + "']"
			},
			dataType: "json",
			success: function(data) {
				if(data[0].TAG == "0"){
					window.location.href="./error.html";
				}else{
					document.getElementById("fj_name").value = data[0].B_NAME;
					document.getElementById("fj_jm").value = data[0].BRIEF_CODE;
				}
			}
		});
	})
})(jQuery);

function up_Enclosure(){
	var fj_name = document.getElementById("fj_name").value;
	var fj_jm = document.getElementById("fj_jm").value;
	$.ajax({
		url: "../../../../service",
		cache: false,
		data: {
			proc: "g_xmy.up_Enclosure",
			para: "['" + username + "','" + secretkey + "','" + annex_id + "','" + fj_name + "','" + fj_jm + "']"
		},
		dataType: "json",
		success: function(data){
			if (data[0].TAG == "0" ){
				window.location.href="./error.html";
			}else {
				layer.alert("修改成功!",function(index){
					 window.location.href="./attachment_gement.html";
					 layer.close(index);
				});
			}
		}
	});
}






